
import { NavLink, useParams } from "react-router-dom";
function Nav() {
    const { type = "all" } = useParams();
    return (
        <nav className="nav">
            <NavLink to="/list" exact isActive={() => {
                return type === "all";
            }} >全部</NavLink>
            <NavLink to="/list/good" exact isActive={() => {
                return type === "good"
            }} >精华</NavLink>
            <NavLink to="/list/share" exact isActive={() => {
                return type === "share"
            }} >分享</NavLink>
            <NavLink to="/list/ask" exact isActive={() => {
                return type === "ask"
            }}>问答</NavLink>
        </nav>
    )
}

export default Nav;